# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

DESCRIPTION="Game library managment"
HOMEPAGE="https://notabug.org/johncena141/rum"
SRC_URI="https://notabug.org/johncena141/rum/archive/v${PV}.tar.gz"

LICENSE="AGPL-3"
SLOT="0"
KEYWORDS="~amd64"
S="${WORKDIR}/rum"

RESTRICT="network-sandbox"

RDEPEND="
		net-libs/webkit-gtk
        net-misc/curl
        net-misc/wget
        dev-libs/openssl
        x11-misc/appmenu-gtk-module
        gui-libs/gtk
        dev-libs/libappindicator
		"
DEPEND="${RDEPEND}
		virtual/rust
        dev-vcs/git
        net-libs/nodejs
        dev-util/patchelf
        sys-fs/squashfs-tools
	   "
src_compile() {
    export RUSTUP_TOOLCHAIN=stable
    npm install
    npm run build
    npm run tauri build
}

src_install() {
    install -Dm0755 -t "${D}/usr/bin/" "src-tauri/target/release/rum"
    install -Dm644 ./rum.desktop "${D}/usr/share/applications/rum.desktop"
    install -Dm644 ./icon.svg "${D}/usr/share/pixmaps/rum.svg"
}
